/**
 *  private.h
 *  Copyright (c) 2012 Neolink Co.Ltd
 */
#ifndef __SERIAL_PRIVATE_H
#define __SERIAL_PRIVATE_H

#if defined(LOGD)
#include "../logd/logd.h"
#define serial_printf              log_none
#else
#include <stdio.h>
#define serial_printf              printf
#endif

#define SERIAL_INTERVAL_MSEC_SPLIT_SEC(t) \
	((t) / 1000)

#define SERIAL_INTERVAL_MSEC_SPLIT_USEC(t) \
	((t % 1000) * 1000)

/** define the serial type */
#if defined(WIN32)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <process.h>
#include <io.h>
typedef HANDLE serial_t;
#define SERIAL_INVALID INVALID_HANDLE_VALUE
#else 
typedef int serial_t;
#define SERIAL_INVALID -1
#endif


#endif /* __SERIAL_PRIVATE_H */
